Cannot call action method 'System.Web.Mvc.PartialViewResult Foo[T](T)' on controller 'Controller' be

Posted by MedicineMan on Stack Overflow See other posts from Stack Overflow or by MedicineMan
Published on 2010-05-19T23:22:17Z Indexed on 2010/05/19 23:30 UTC
Read the original article Hit count: 274

Cannot call action method 'System.Web.Mvc.PartialViewResult FooT' on controller 'Controller' because the action method is a generic method

<% Html.RenderAction("Foo", model = Model}); %>

Is there a workaround for this limitation on ASP MVC 2? I would really prefer to use a generic. The workaround that I have come up with is to change the model type to be an object. It works, but is not preferred:

    public PartialViewResult Foo<T>(T model) where T : class
    {
      // do stuff
    }

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about asp.net-mvc-2